package com.bwie.controller;
import com.bwie.pojo.Type;
import com.bwie.service.Impl.TypeServiceImpl;
import com.bwie.service.TypeService;
import com.bwie.utils.R;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;

/**
* 商品分类表(tb_type)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/shop/type")
public class TypeController {
/**
* 服务对象
*/
    @Autowired
    private TypeService typeService;
    @PostMapping("/getTypeTree")
    public R getTypeTree(){
        return typeService.getTypeTree();
    }
    @PostMapping("/getSelectTypeTree")
    public R getSelectTypeTree(){
        return typeService.getSelectTypeTree();
    }
    @PostMapping("/addTypeList")
    public R addTypeList(
        @RequestBody Type type
    ){
        return typeService.addTypeList(type);
    }
    @PostMapping("/uploadTypeImage")
    public R uploadTypeImage(
            @RequestPart("file")MultipartFile file
            ){
        return typeService.uploadTypeImage(file);
    }
}
